kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumo-pub/hadar
    REF "v${VERSION}"
    SHA512 f1cfc7e0a4682d6007f6f4ff9b01c6718c41f5b9b63199fc2c789fff21c062745f48181ad8af1f1e728a68190fafd53d164d49ab6b427644cade67c3ec3eaed5
    HEAD_REF master
)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    OPTIONS
        -DKMCMAKE_BUILD_TEST=OFF
        -DKMCMAKE_BUILD_BENCHMARK=OFF
)

kmpkg_cmake_install(
    DISABLE_PARALLEL
)

kmpkg_copy_pdbs()
kmpkg_cmake_config_fixup(PACKAGE_NAME hadar CONFIG_PATH lib/cmake/hadar)
kmpkg_fixup_pkgconfig()

kmpkg_copy_tools(TOOL_NAMES hadar_cc AUTO_CLEAN)
kmpkg_copy_tools(TOOL_NAMES hadar_dict AUTO_CLEAN)
kmpkg_copy_tools(TOOL_NAMES hadar_phrase_extract AUTO_CLEAN)


file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
